package thread;

public class ThreadDemo32 {
    private static int result = 0;

    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                for(int i = 1; i <= 1000; i++){
                    result += i;
                }
            }
        });

        t.start();
        t.join();

        System.out.println("result = " + result);
    }
}
